package com.newzqxq.common.enums;

public enum PayStatusEnums {
     PENDING("PENDING","等待打款支付"),
     COMPLETED("COMPLETED","打款完成")
    ,FAILED("FAILED","打款失败")
    ,DUPLICATE_TRANSACTION_ERROR("DUPLICATE_TRANSACTION_ERROR","重复的交易码")
    ,API_VALIDATION_ERROR("API_VALIDATION_ERROR","参数字段校验失败")
    ,INVALID_JSON_FORMAT("INVALID_JSON_FORMAT","无效的 JSON 格式")
    ,DISBURSEMENT_DESCRIPTION_NOT_FOUND_ERROR("DISBURSEMENT_DESCRIPTION_NOT_FOUND_ERROR","订单无描述信息")
    ,DIRECT_DISBURSEMENT_BALANCE_INSUFFICIENT_ERROR("DIRECT_DISBURSEMENT_BALANCE_INSUFFICIENT_ERROR","余额不足")
    ,BANK_CODE_NOT_SUPPORTED_ERROR("BANK_CODE_NOT_SUPPORTED_ERROR","不支持的银行代码")

    ;

    private String code;
    private String message;
    public static PayStatusEnums getByCode(String code){
        for (PayStatusEnums enums: PayStatusEnums.values()){
            if (enums.getCode().equals(code)){
                return enums;
            }
        }
        return null;
    }
    PayStatusEnums(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
